package au.csiro.nt.psdp.manager.Impl;

import au.csiro.nt.psdp.model.Role;
import au.csiro.nt.psdp.manager.RoleManager;
import au.csiro.nt.psdp.dao.RoleDao;

import java.util.List;

import org.appfuse.service.impl.UniversalManagerImpl;

/**
 * Implementation of RoleManager interface.
 *

 */
public class RoleManagerImpl extends UniversalManagerImpl implements RoleManager
{
    private RoleDao dao;

    public void setRoleDao(RoleDao dao)
    {
        this.dao = dao;
    }

    public List<Role> getRoles(Role role)
    {
        return dao.getAll();
    }

    public Role getRole(String rolename)
    {
        return dao.getRoleByName(rolename);
    }

    public void saveRole(Role role)
    {
        dao.save(role);
    }

    public void removeRole(String rolename)
    {
        dao.removeRole(rolename);
    }
}